/*赞赏弹出*/
$('#payButton').popup({
    popup: $('.payQR.popup'),
    on: 'click',
    position: 'bottom center'
});

/*--------------目录--------------*/
/*目录生成*/
tocbot.init({
    // Where to render the table of contents.
    tocSelector: '.js-toc',
    // Where to grab the headings to build the table of contents.
    contentSelector: '.js-toc-content',
    // Which headings to grab inside of the contentSelector element.
    headingSelector: 'h1, h2, h3',
    // For headings inside relative or absolute positioned containers within content.
    hasInnerContainers: true,
});
/*目录弹出*/
$('#catalogButton').popup({
    popup: $('.catalog-container.popup'),
    on: 'click',
    position: 'left center'
});

/*--------------二维码--------------*/
/*二维码生成*/
var qrcode = new QRCode("qrcode", {
    text: "http://jindo.dev.naver.com/collie",
    width: 100,
    height: 100,
    colorDark: "#000000",
    colorLight: "#ffffff",
    correctLevel: QRCode.CorrectLevel.H
});
/*二维码弹出*/
$('.wechat.button').popup({
    popup: $('.wechat-qr.popup'),
    position: 'left center'
});

/*--------------滑动--------------*/
/*滑动*/
$('#toTop-button').click(function () {
    $(window).scrollTo(0, 500)
});
/*滑动监测*/
var waypoint = new Waypoint({
    element: document.getElementById('waypoint'),
    handler: function (direction) {
        if (direction == 'down') {
            $('#toolbar').show();
        } else {
            $('#toolbar').hide(500);
        }
    }
})
